f = open('zhuce.txt', 'r', encoding='utf-8')
du = f.read()
sz = du.split("\n")
print(sz)
zd = {}
for i in sz:
    z = i.split(":")
    # print(z)
    name = z[0]
    password = z[1]
    zd[name] = password
key = zd.keys()
print(key)
for i in range(3):
    ming = input("用户名：").lower().strip()
    mima = input("密码：").strip()
    if ming == "" or mima =="":
        print("用户名或密码不能为空")
    elif ming in key:
        if zd[ming] == mima:
            print("登录成功，欢迎")
            break
        else:
            print("密码错误")
    else:
        print("用户不存在")